/*
 * CLogon.h
 *
 *      Author: grifos
 */

#ifndef CLOGON_H_
#define CLOGON_H_

#include <vector>
#include <osg/Drawable>
#include <osg/ShapeDrawable>
#include <osg/Group>
#include <osg/Material>
#include <osgViewer/Viewer>
#include <osg/PositionAttitudeTransform>

#include <osg/Texture2D>
#include <osgDB/ReadFile>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/StateSetManipulator>
#include <osg/Transform>
#include <osg/MatrixTransform>
#include <osg/BlendFunc>
#include<osg/AlphaFunc>



#include <gmtl/Vec.h>
#include <gmtl/Math.h>
#include <gmtl/Coord.h>
#include <gmtl/Xforms.h>

class CLogon {
private:
	osg::ref_ptr<osg::PositionAttitudeTransform> mBaseNode; // le noeud de base qui va positionner le cube à l'endroit voulu
	osg::ref_ptr<osg::MatrixTransform> mCubeRotation; // Le noeud de rotation du cube
	osg::ref_ptr<osg::Geode> mCubeGeode; // Le noeud contenant les primitive du cube
	float mX, mY, mZ;

	osg::Texture2D* mTexture;
	osg::StateSet* mTextureState;
	void loadTexture(char*);

	int _bliting;
	float _blitTime;
	float _timeElapsed;
	int _display;

public:
	CLogon(float x, float y, float z, char* texPath, int bliting, float blittime);
	void update(float d);
	void setBliting(int v){ _bliting = v; }

	osg::PositionAttitudeTransform* getNode() { return mBaseNode.get(); }
	virtual ~CLogon();
};

#endif /* CLOGON_H_ */
